home *** CD-ROM | disk | FTP | other *** search
/ 3D Games - Real-time Rend…ng & Software Technology / 3D Games - Real-time Rendering & Software Technology.iso / flysdk / plugin / lights / lights.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-03-23  |  2.6 KB  |  142 lines

  1. enum 
  2. {
  3.     TYPE_LIGHT=0x120,
  4.     TYPE_SPOT_LIGHT,
  5.     TYPE_SPRITE_LIGHT,
  6.     TYPE_MESH_LIGHT,
  7. };
  8.  
  9. class light;
  10. class spot_light;
  11. class sprite_light;
  12. class mesh_light;
  13.  
  14. class light : public bsp_object
  15. {
  16.     public:
  17.  
  18.         vector color;
  19.         float illum_radius;
  20.         bsp_object *shadow_obj;
  21.         sprite_light *s;
  22.         float grow;
  23.         int shadowmode;
  24.  
  25.     int step(int dt);
  26.     void draw();
  27.     int get_custom_param_desc(int i,param_desc *pd);
  28.  
  29.     inline bsp_object *clone() 
  30.     { 
  31.         light *l=new light;
  32.         *l=*this;
  33.         l->source=this;
  34.         return l; 
  35.     };
  36.  
  37.     light() { type=TYPE_LIGHT; };
  38. };
  39.  
  40. class spot_light : public bsp_object
  41. {
  42.     public:
  43.  
  44.         float maxdist;
  45.         vector color;
  46.         light *l;
  47.  
  48.     spot_light() 
  49.     { type=TYPE_SPOT_LIGHT; };
  50.     int get_custom_param_desc(int i,param_desc *pd);
  51.     virtual void reposition(bsp_object *obj);
  52.  
  53.     inline bsp_object *clone() 
  54.     { 
  55.         spot_light *l=new spot_light;
  56.         *l=*this;
  57.         l->source=this;
  58.         return l; 
  59.     };
  60. };
  61.  
  62. class sprite_light : public bsp_object
  63. {
  64.     public:
  65.  
  66.         int texture;
  67.         int mode;
  68.         vector color;
  69.         float size;
  70.         float grow;
  71.  
  72.     int step(int dt);
  73.     void draw();
  74.     int get_custom_param_desc(int i,param_desc *pd);
  75.  
  76.     inline bsp_object *clone() 
  77.     { 
  78.         sprite_light *l=new sprite_light;
  79.         *l=*this;
  80.         l->source=this;
  81.         return l; 
  82.     };
  83.     sprite_light() { type=TYPE_SPRITE_LIGHT; }
  84. };
  85.  
  86. class mesh_light : public bsp_object
  87. {
  88.     public:
  89.  
  90.         mesh *objmesh;
  91.         float illum_radius;
  92.         vector color;
  93.         int halopic;
  94.         float halosize;
  95.         int lastdraw;
  96.  
  97.     int step(int dt);
  98.     void draw();
  99.     int get_custom_param_desc(int i,param_desc *pd);
  100.     void init();
  101.     mesh *get_mesh() { return objmesh; };
  102.     int message(vector& p,float rad,int msg,int param,void *data);
  103.  
  104.     inline bsp_object *clone() 
  105.     { 
  106.         mesh_light *l=new mesh_light;
  107.         *l=*this;
  108.         l->source=this;
  109.         return l; 
  110.     };
  111.     mesh_light() { type=TYPE_MESH_LIGHT; color.vec(1,1,1,0); }
  112. };
  113.  
  114. class light_desc : public class_desc
  115. {
  116. public:
  117.     void *create() { return new light; };
  118.     char *get_name() { return "light"; };
  119.     int get_type() { return TYPE_LIGHT; };
  120. };
  121. class spot_light_desc : public class_desc
  122. {
  123. public:
  124.     void *create() { return new spot_light; };
  125.     char *get_name() { return "spotlight"; };
  126.     int get_type() { return TYPE_SPOT_LIGHT; };
  127. };
  128. class sprite_light_desc : public class_desc
  129. {
  130. public:
  131.     void *create() { return new sprite_light; };
  132.     char *get_name() { return "spritelight"; };
  133.     int get_type() { return TYPE_SPRITE_LIGHT; };
  134. };
  135. class mesh_light_desc : public class_desc
  136. {
  137. public:
  138.     void *create() { return new mesh_light; };
  139.     char *get_name() { return "meshlight"; };
  140.     int get_type() { return TYPE_MESH_LIGHT; };
  141. };
  142.